/*
* Revision of last commit: $Rev$
* Author of last commit: $Author$
* Date of last commit: $Date$
*/

#ifndef _TRACE_H_INCLUDED_
#define _TRACE_H_INCLUDED_

#include <string>

/**
TRACELOG define indicates that logs are simple active
TRACENOTE define indicates that all non-critical note information will be saved.
TRACEDEV define indicates that all developer info will be saved (use ctrace).
TRACEFAIL define indicates that the most critical info about state of program during fail will be saved.
*/
#ifdef TRACELOG

#ifdef TRACENOTE
#define cnote(msg) ::Core::Cmn::CTracer << "[NOTE]: In file: " << __FILE__ << " Line: (" << __LINE__ << ") In function" << __FUNC__ << msg
#else
#define cnote(msg)
#endif

#ifdef TRACEDEV
#define ctrace(msg) ::Core::Cmn::CTracer << "[DEV] In file: " << __FILE__ << " Line: (" << __LINE__ << ") In function" << __FUNC__ << msg
#else
#define ctrace(msg)
#endif

#ifdef TRACEFAIL
#define cfail(msg) ::Core::Cmn::CTracer << "[FAIL]: In file: " << __FILE__ << " Line: (" << __LINE__ << ") In function" << __FUNC__ << msg
#else
#define cfail(msg)
#endif

#define TR_FUNC(arg) ::Core::Cmn::CFuncTracer

#else

#define cnote(msg)
#define ctrace(msg)
#define cfail(msg)
#define TR_FUNC(args)

#endif

namespace Core
{
namespace Cmn
{

/**
@brief 
@descr 
*/
class CFuncTracer
{
public:
	CFuncTracer(const std::string& strMessage) throw();
	~CFuncTracer() throw();
private:
	const std::string m_strMessage;
};

/**
@brief This class is for internal use only. Please use macros above (cfail, ctrace, cnote).
@descr This class is a simple interface for hidden in cpp file Logger class.
*/
class CTracer
{
public:
	CTracer& operator << (const std::string&) throw();
	CTracer& operator << (const char* const) throw();
};

} //namespace Cmn
} //namespace Core

#endif //_TRACE_H_INCLUDED_